//-------------------------------------------------------------------
//	Copyright (c) 2010-2012 Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_SAMPLER_MANAGER_H
#define _UX_SAMPLER_MANAGER_H

#include "../GLshell/AllGLshellTypes.h"

namespace Engine
{
namespace RenderUtils
{

	//
	// Sampler Manager
	//

	class _EXPORT_ CSamplerManager : public CEngBaseObject
	{
	private:
		array< CSampler, TSafeCopyStrategy< CSampler > >	_aSamplers;

	private:
		virtual void Release();

	public:
		CSamplerManager();
		~CSamplerManager();

		void BindSampler(uint uID, uint8 uStage) const;
		bool GetSamplerID(e_tex_flags::type eFlags, uint &uID);
	};


	
	inline void CSamplerManager::BindSampler(uint uID, uint8 uStage) const
	{
		_aSamplers[ uID ].Bind( uStage );
	}

//-------------------------------------------------------------------

}	// RenderUtils
}	// Engine

#endif	// _UX_SAMPLER_MANAGER_H